<template>
	<view class="pages">
		<scroll-view scroll-y="true" class='contentbox' @scrolltolower="scrolltolower">
			<view v-if="list.length == 0">
				<view style="height: 100rpx;"></view>
				<u-empty text=" - 暂无数据 - " mode="list"></u-empty>
			</view>
			<view class="c3 uniBtn" v-for="(item,index) in list" :key="index">
				<view class="c3-1">
					<view class="uniFlex">
						<image :src="item.user.avatar" mode=""></image>
						<view>{{item.user.nickname}}</view>
					</view>
					<view class="c3-1-buy">已购商品：<text style="color: #E9A49E;">x1</text></view>
				</view>
				<view class="c3-2">{{item.pay_time}}</view>
			</view>
		</scroll-view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
				list:[]
			}
		},
		async onLoad(options) {
			this.id = options.id;
			await this.getList();
		},
		methods: {
			// 列表
			async getList() {
				let res = await this.$api.buylist({
					goods_id: this.id
				});
				if (res.code == 1) {
					this.list = res.data;
				}
			}
		}
	}
</script>

<style scoped lang="less">
	.pages{
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		overflow: hidden;
		display: flex;
		flex-direction: column;
	}
	.contentbox{
		flex: 1;
		overflow: hidden;
		padding: 30rpx 0;
		.c3{
			padding: 30rpx 20rpx;
			font-size: 24rpx;
			background: #fff;
			margin:0 25rpx 30rpx 25rpx;
			border-radius: 10rpx;
			.c3-1{
				.uniFlex{
					font-size: 30rpx;
					font-weight: 400;
					image{
						width: 74rpx;
						height: 74rpx;
						border-radius: 50%;
						margin-right: 16rpx;
					}
				}
				.c3-1-buy{
					color: #6F6F6F;
					font-size: 28rpx;
					margin-top: 16rpx;
				}
			}
			
			.c3-2{
				font-size: 28rpx;
				color: #6F6F6F;
			}
		}
	}
	
</style>